package com.epam.lissina.controller;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.epam.lissina.entity.Tour;
import com.epam.lissina.entity.TravelAgency;
import com.epam.lissina.factory.AgencyFactory;
import com.epam.lissina.utils.SortComparator;

public class Runner {

	public static void main(String[] args) {

		List<TravelAgency> list = AgencyFactory.build();
		List<Tour> tours = new ArrayList<Tour>();
		for (TravelAgency t : list) {
			tours.addAll(t.getTours());
		}

		Collections.sort(tours, new SortComparator());
		for (Tour tour : tours) {
			System.out.println(tour.toString());
		}

		/*
		 * Collections.sort(tours); for (Tour t : tours) { //
		 * System.out.println(t.getTransport());
		 * System.out.println(t.toString()); }
		 */
	}
}